﻿@{
    ViewBag.Title = "ProductEditCs";
}
@section scripts
{
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <link href="~/Scripts/miniui/themes/default/medium-mode.css" rel="stylesheet" type="text/css" />       
}

<form id="form1" method="post">
        <div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;"> 
            <table style="width:100%;">
                <tr>
                    <td style="width:100%;">
                        <a class="mini-button" name="SaveInfo" iconCls="icon-ok" onclick="onOk" plain="true">确定</a>                        
                        <span class="separator"></span>
                        <a class="mini-button" iconCls="icon-close" onclick="CloseWindow" plain="true">关闭</a>
                    </td>
                </tr>
            </table>                
        </div>
        <div name="Base" title="系统激活" style="height:98%;overflow:hidden;margin-top:25px;margin-left:70px">
            <table>
                <tr>
                    <td width="80px" height="50px"  align="right">条码：</td>
                    <td width="200px" >
                        <input name="FCode" class="mini-textbox" style="width: 200px;" value="" TabIndex="1"/>
                    </td>
                </tr>
                <tr>
                    <td width="80px"  height="50px" align="right">颜色：</td>
                    <td width="190px" >
                        @Html.Partial("~/Views/Modular/LookupColor.cshtml")
                    </td>
                </tr>
                <tr>
                    <td width="80px"  height="50px" align="right">尺码：</td>
                    <td width="190px" >
                        @Html.Partial("~/Views/Modular/LookupSize.cshtml")
                    </td>
                </tr>
            </table>
        </div>
</form>

<script>
    mini.parse();
    var form = new mini.Form("form1");

    function SetData(data) {
        mini.getbyName("FColorNumber").setValue(data.FColorID);
        mini.getbyName("FColorNumber").setText(data.FColorNumber);
        mini.getbyName("FColorName").setValue(data.FColorName);
        mini.getbyName("FSizeNumber").setValue(data.FSizeID);
        mini.getbyName("FSizeNumber").setText(data.FSizeNumber);
        mini.getbyName("FSizeName").setValue(data.FSizeName);
        mini.getbyName("FCode").setValue(data.FCsCode);
    }

    function onOk(e) {
        if (mini.getbyName("FColorNumber").getValue() == "") {
            mini.alert("颜色不能为空");
            return;
        }
        if (mini.getbyName("FSizeNumber").getValue() == "") {
            mini.alert("尺码不能为空");
            return;
        }

        var sdata = form.getData();

        var dataRow = {
            FCsCode: sdata.FCode, FSizeID: mini.getbyName("FSizeNumber").getValue(),
            FSizeName: sdata.FSizeName, FSizeNumber: sdata.FSizeNumber,
            FColorID: mini.getbyName("FColorNumber").getValue(),
            FColorName: sdata.FColorName, FColorNumber: sdata.FColorNumber
        };
        CloseWindow(dataRow);
    }

</script>